Skip to content

Fix URL building logic #1320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 29, 2025
Merged

Fix URL building logic #1320

merged 12 commits into from
Apr 29, 2025

Conversation

artur-ciocanu
Copy link
Contributor

Description

This is a tiny PR that fixes the URL building logic in the DaprHttp functionality. This is trying to fix an issue where we tried to replace the OkHttp URL builder with something that uses JDK URI.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1314

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@artur-ciocanu artur-ciocanu requested review from a team as code owners April 21, 2025 16:33
@artur-ciocanu
Copy link
Contributor Author

@rahulpoddar-fyndna and @vikram-mahadevkar this is the fix for #1314. We hope to release it as soon as possible.

@artur-ciocanu
Copy link
Contributor Author

@cicoyle @mcruzdev @salaboy could you please take a look. This might need a hot fix.

@artur-ciocanu artur-ciocanu force-pushed the gh-1314 branch 2 times, most recently from 6de971a to bb030d1 Compare April 23, 2025 15:03
Artur Ciocanu added 3 commits April 23, 2025 10:14
Signed-off-by: Artur Ciocanu <[email protected]>
Signed-off-by: Artur Ciocanu <[email protected]>
Signed-off-by: Artur Ciocanu <[email protected]>
Artur Ciocanu added 6 commits April 23, 2025 13:21
Copy link
Contributor

@siri-varma siri-varma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Artur Ciocanu added 3 commits April 25, 2025 21:07
Signed-off-by: Artur Ciocanu <[email protected]>
Signed-off-by: Artur Ciocanu <[email protected]>
Signed-off-by: Artur Ciocanu <[email protected]>
@artur-ciocanu
Copy link
Contributor Author

artur-ciocanu commented Apr 26, 2025

@cicoyle @salaboy and @mcruzdev I have figured what was the problem with my setup. Here is the breakdown:

  • To be able to use named parameters in Spring we have to either adjust the Java compiler arguments or make sure that we use @RequestParam("uri") String uri, otherwise this results in runtime exceptions and eventually ends up as HTTP 500.
  • On my local box mDNS is not working, hence service to service was failing. I have no idea how to fix it, the way I managed to overcome this is by using SQLite name resolution.

After I have went through all this hurdles, I was able to confirm that my fix works and there are no more double encodings.

@cicoyle and @salaboy could you please review and approve. Thank you!

CC: @rdosifyndna

@artur-ciocanu
Copy link
Contributor Author

@cicoyle and @salaboy since the name resolution based on mDNS can be such a pain should we use SQLite name resolution in our ITs. I think this should make our tests a little bit more predictable and reliable.

Any thoughts?

@artur-ciocanu artur-ciocanu requested a review from cicoyle April 28, 2025 21:36
@cicoyle cicoyle merged commit b7e45a0 into dapr:master Apr 29, 2025
8 of 9 checks passed
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 77.11%. Comparing base (d759c53) to head (74a769e).
Report is 134 commits behind head on master.

Files with missing lines Patch % Lines
sdk/src/main/java/io/dapr/client/DaprHttp.java 50.00% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1320      +/-   ##
============================================
+ Coverage     76.91%   77.11%   +0.19%     
- Complexity     1592     1729     +137     
============================================
  Files           145      200      +55     
  Lines          4843     5291     +448     
  Branches        562      579      +17     
============================================
+ Hits           3725     4080     +355     
- Misses          821      899      +78     
- Partials        297      312      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cicoyle pushed a commit to cicoyle/java-sdk that referenced this pull request Apr 29, 2025
* Fix URL building logic

Signed-off-by: Artur Ciocanu <[email protected]>

* Add test for query params

Signed-off-by: Artur Ciocanu <[email protected]>

* Fix the assertion in the test

Signed-off-by: Artur Ciocanu <[email protected]>

* Adjust the tests

Signed-off-by: Artur Ciocanu <[email protected]>

* Remove uneeded changes from IT test

Signed-off-by: Artur Ciocanu <[email protected]>

* Revert some unintended changes

Signed-off-by: Artur Ciocanu <[email protected]>

* Simplify the testing a little bit

Signed-off-by: Artur Ciocanu <[email protected]>

* Adjust the test to use ServerRequest

Signed-off-by: Artur Ciocanu <[email protected]>

* Test removing things from method invoke controller

Signed-off-by: Artur Ciocanu <[email protected]>

* Add query param encoding test

Signed-off-by: Artur Ciocanu <[email protected]>

* Revert some unintended changes

Signed-off-by: Artur Ciocanu <[email protected]>

* Some tiny styles

Signed-off-by: Artur Ciocanu <[email protected]>

---------

Signed-off-by: Artur Ciocanu <[email protected]>
Co-authored-by: Artur Ciocanu <[email protected]>
cicoyle pushed a commit to cicoyle/java-sdk that referenced this pull request Apr 29, 2025
* Fix URL building logic

Signed-off-by: Artur Ciocanu <[email protected]>

* Add test for query params

Signed-off-by: Artur Ciocanu <[email protected]>

* Fix the assertion in the test

Signed-off-by: Artur Ciocanu <[email protected]>

* Adjust the tests

Signed-off-by: Artur Ciocanu <[email protected]>

* Remove uneeded changes from IT test

Signed-off-by: Artur Ciocanu <[email protected]>

* Revert some unintended changes

Signed-off-by: Artur Ciocanu <[email protected]>

* Simplify the testing a little bit

Signed-off-by: Artur Ciocanu <[email protected]>

* Adjust the test to use ServerRequest

Signed-off-by: Artur Ciocanu <[email protected]>

* Test removing things from method invoke controller

Signed-off-by: Artur Ciocanu <[email protected]>

* Add query param encoding test

Signed-off-by: Artur Ciocanu <[email protected]>

* Revert some unintended changes

Signed-off-by: Artur Ciocanu <[email protected]>

* Some tiny styles

Signed-off-by: Artur Ciocanu <[email protected]>

---------

Signed-off-by: Artur Ciocanu <[email protected]>
Co-authored-by: Artur Ciocanu <[email protected]>
Signed-off-by: Cassandra Coyle <[email protected]>
cicoyle added a commit that referenced this pull request Apr 29, 2025
* Fix URL building logic



* Add test for query params



* Fix the assertion in the test



* Adjust the tests



* Remove uneeded changes from IT test



* Revert some unintended changes



* Simplify the testing a little bit



* Adjust the test to use ServerRequest



* Test removing things from method invoke controller



* Add query param encoding test



* Revert some unintended changes



* Some tiny styles



---------

Signed-off-by: Artur Ciocanu <[email protected]>
Signed-off-by: Cassandra Coyle <[email protected]>
Co-authored-by: artur-ciocanu <[email protected]>
Co-authored-by: Artur Ciocanu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dapr SDK 1.14.0 Issue with Slash "\" in URI
3 participants